#ifndef SEMANTCIPARSING_H
#define SEMANTCIPARSING_H

#include <string>
using std::string;

//const string SNDA_BASE_URL = "http://58.215.180.12:9000/SVCAParseService/parser";
const string SNDA_BASE_URL = "http://58.215.169.94:9000/SVCAParseService/parser";
const string DEFAULT_IMEI = "358967048453318";
const int BUFF_SIZE = 2048;

class SemanticParser
{
public:
	SemanticParser() : mBaseUrl(SNDA_BASE_URL), mTimeOut(5){};
	~SemanticParser(){};
	void SetBaseUrl(string url);
	void SetTimeOut(size_t timeOut);
	string SemanticParsing(const string& key, const string imei = DEFAULT_IMEI);
private:
	string HttpQuery(string& url);
	bool IsValidResult(std::string&);
	string mBaseUrl;
	int mTimeOut;
};

#endif
